package action;

import java.sql.Driver;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import entity.Customer;
import entity.User;

public class WelcomeUserAction extends ActionSupport implements ModelDriven<Customer>{
    
    private String username;
    private String name;
    private int age;
    
    private Customer customerModel;
    private User userModel;
    
    public String getUsername() {
        return username;
    }
 
    public void setUsername(String username) {
        this.username = username;
    }
    
    
 
    /**
     * Get value of name.
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * Set the value for name.
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Get value of age.
     * @return the age
     */
    public int getAge() {
        return age;
    }

    /**
     * Set the value for age.
     * @param age the age to set
     */
    public void setAge(int age) {
        this.age = age;
    }

    /**
     * Get value of customerModel.
     * @return the customerModel
     */
    public Customer getCustomerModel() {
        return customerModel;
    }

    /**
     * Set the value for customerModel.
     * @param customerModel the customerModel to set
     */
    public void setCustomerModel(Customer customerModel) {
        this.customerModel = customerModel;
    }

    // all struts logic here
    public String execute() {
        customerModel = new Customer();
        
        System.out.println(getName());
        System.out.println(getAge());
        System.out.println(name);
        customerModel.setName(getName());
        customerModel.setAge(getAge());
        userModel.setAge(getAge());
        return "SUCCESS";
 
    }

    @Override
    public Customer getModel() {
        // TODO Auto-generated method stub
        return null;
    }
}
